<%@ page import="entity.Question" %><%--
  Created by IntelliJ IDEA.
  User: 44814
  Date: 2021/7/3
  Time: 17:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    Question q = (Question) request.getAttribute("question");
%>
<center>
    <form action="/myWeb/question/update">
        <table border="2px">
            <tr>
                <td>题目编号：</td>
                <td><input type="text" name="questionId" value="<%=q.getQuestionId()%>" readonly></td>
            </tr>
            <tr>
                <td>题目内容：</td>
                <td><input type="text" name="title" value="<%=q.getTitle()%>"></td>
            </tr>
            <tr>
                <td>选项A：</td>
                <td><input type="text" name="optionA" value="<%=q.getOptionA()%>"></td>
            </tr>
            <tr>
                <td>选项B：</td>
                <td><input type="text" name="optionB" value="<%=q.getOptionB()%>"></td>
            </tr>
            <tr>
                <td>选项C：</td>
                <td><input type="text" name="optionC" value="<%=q.getOptionC()%>"></td>
            </tr>
            <tr>
                <td>选项D：</td>
                <td><input type="text" name="optionD" value="<%=q.getOptionD()%>"></td>
            </tr>
            <tr>
                <td>答案：</td>
                <td>
                    <input type="radio" name="answer" value="A" <%="A".equals(q.getAnswer()) ? "checked" : ""%>>A
                    <input type="radio" name="answer" value="B" <%="B".equals(q.getAnswer()) ? "checked" : ""%>>B
                    <input type="radio" name="answer" value="C" <%="C".equals(q.getAnswer()) ? "checked" : ""%>>C
                    <input type="radio" name="answer" value="D" <%="D".equals(q.getAnswer()) ? "checked" : ""%>>D
                </td>
            </tr>
            <tr>
                <td><input type="submit" value="更新试题"></td>
                <td><input type="reset" value="重置"></td>
            </tr>
        </table>
    </form>
</center>
